package com.guigu.youxuan.controller;

import com.guigu.youxuan.pojo.OrderDetails;
import com.guigu.youxuan.pojo.PurchaseOrderDetails;
import com.guigu.youxuan.service.IPurchaseOrderDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liweixin
 * @since 2024-05-15
 */
@CrossOrigin
@Controller
@RequestMapping("/purchaseOrderDetails")
public class PurchaseOrderDetailsController {
    @Autowired
    private IPurchaseOrderDetailsService iPurchaseOrderDetailsService;
    /**
     * 供应商根据商品表id查询对应的商品信息
     * @param id
     * @return
     */
    @RequestMapping("/OrderDetailsById/{id}")
    @ResponseBody
    public PurchaseOrderDetails OrderDetailsById(@PathVariable int id){
        PurchaseOrderDetails goodsInfo=this.iPurchaseOrderDetailsService.getById(id);
        return goodsInfo;
    }
}
